package com.heba.greenmulu;

import android.os.Bundle;
import android.webkit.WebView;

import com.heba.config.CommonConfig;
import com.heba.helper.WebViewHelper;

/**
 * Created by jason on 2019/4/10.
 */
public class WebviewActivity extends BaseActivity {

    private WebView webView;

    private String title = "";
    private String url = "";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_webview);
        initTopbar();
        findViewById();
        initView();
    }

    @Override
    protected void findViewById() {
        webView = findViewById(R.id.webview);
    }

    @Override
    protected void initView() {
        Bundle bundle = getIntent().getExtras();
        if (null != bundle) {
            title = bundle.getString(CommonConfig.WEBVIEW_TITLE, "");
            url = bundle.getString(CommonConfig.WEBVIEW_URL, "");
        }
        txt_title.setText(title);


        /**
         * webview設置
         */
        WebViewHelper.Set(webView);
        webView.loadUrl(url);
    }
}
